package cate.common.table.herodirectbuy.row;

import cate.common.table.ERow;
import cate.common.table.XSSFRowWrap;
import cate.common.util.random.RWItem;
import easy.java.dev.note.NoteField;

public class HeroDirectBuyPoolRow  extends ERow implements RWItem {
    @NoteField("配置ID")
    public int confitTid;

    @NoteField("奖励")
    public String rewardStr;

    @NoteField("购买类型")
    public int type;

    @NoteField("充值项ID")
    public int payId;

    @NoteField("原价(人民币：元，钻石：个数)")
    public String priceOld;

    @NoteField("现价(人民币：元，钻石：个数)")
    public String priceNow;

    @NoteField("折扣")
    public int discount;

    @NoteField("是否稀有")
    public boolean isRare;

    @NoteField("权重")
    public int weight;

    @NoteField("是否参与首次作弊")
    public boolean isFirst;

    @NoteField("钻石购买")
    public static final int TYPE_ITEM = 0;
    @NoteField("人民币支付")
    public static final int TYPE_PAY = 1;

    @Override
    public void parse(XSSFRowWrap xrw) {
        super.parse(xrw);
        this.id = xrw.getInteger("ID", 0);
        this.confitTid = xrw.getInteger("配置ID", 0);
        this.rewardStr = xrw.getString("奖励");
        this.type = xrw.getInteger("购买类型", 0);
        this.payId = xrw.getInteger("充值项ID", -1);
        this.priceOld = xrw.getString("原价");
        this.priceNow = xrw.getString("现价");
        this.discount = xrw.getInteger("折扣", 0);
        this.isRare = xrw.getBoolean("是否稀有",false);
        this.weight = xrw.getInteger("权重", 0);
        this.isFirst = xrw.getBoolean("是否参与首次作弊",false);
    }

    @Override
    public double getWeight() {
        return weight;
    }
}
